home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / HENSA / MATHS / PLPLOT / PLPLOT.ZIP / include / plstream.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-25  |  20.7 KB  |  626 lines

  1. /* $Id: plstream.h,v 1.32 1994/08/25 04:03:43 mjl Exp $
  2.  * $Log: plstream.h,v $
  3.  * Revision 1.32  1994/08/25  04:03:43  mjl
  4.  * Added include of pdf.h, since the PLStream data structure requires it
  5.  * in any case.
  6.  *
  7.  * Revision 1.31  1994/07/23  04:46:55  mjl
  8.  * Added pls->server_nokill, which can be set to prevent plserver from dying
  9.  * when a ^C is hit.
  10.  *
  11.  * Revision 1.30  1994/07/19  22:34:46  mjl
  12.  * Eliminated some unnecessary defines.
  13.  *
  14.  * Revision 1.29  1994/06/30  18:37:03  mjl
  15.  * Added status flag to keep track of current page status.
  16.  *
  17.  * Revision 1.28  1994/05/07  03:22:08  mjl
  18.  * Eliminated bgcolor, fgcolor, and bgcolorset.  Now fgcolor is a figment of
  19.  * the X driver's imagination :-).  bgcolor is identically the same as the
  20.  * 0th entry of cmap0.  About time I introduced some sanity to these.
  21.  *
  22.  * Revision 1.27  1994/04/25  19:05:33  mjl
  23.  * Additional support for cmap1 palette.
  24.  *
  25.  * Revision 1.26  1994/04/08  12:20:49  mjl
  26.  * Now includes <plplot.h> in case it hasn't been included yet.  File offset
  27.  * for metafile removed from state structure (now local to driver).  Added:
  28.  * * MouseEH      void*    Mouse event handler
  29.  * * MouseEH_data void*    Pointer to client data to pass
  30.  * * tidy         void*   pointer to cleanup routine
  31.  * * tidy_data    void*   pointer to client data to pass
  32.  * ("tidy" is a user customization tidy routine, to be called before
  33.  * closing a stream to do any program specific cleanup.)
  34.  *
  35.  * Revision 1.25  1994/03/23  07:10:51  mjl
  36.  * Added documentation for all variables not described yet.  Changed some
  37.  * variables used in color map selection.  Added variables:
  38.  *
  39.  *  dev_minor    Minor device id (for variations on one type)
  40.  *  dev_fill0    Set if driver can do solid area fills
  41.  *  dev_fill1    Set if driver can do pattern area fills
  42.  *  finc    Number to increment between member files
  43.  *  fflen    Minimum field length to use in member file number
  44.  *
  45.  * Revision 1.24  1994/02/01  22:46:55  mjl
  46.  * Added pls->user (char *).
  47.  *
  48.  * Revision 1.23  1994/01/25  06:22:17  mjl
  49.  * Added pls->db variable.
  50.  *
  51.  * Revision 1.22  1994/01/15  17:35:09  mjl
  52.  * Added new variables for use in Tcl/TK/DP driver: server_name, server_host,
  53.  * server_port.
  54.  *
  55.  * Revision 1.21  1993/12/21  10:35:46  mjl
  56.  * Added flag to be set by driver to indicate whether TK or DP style
  57.  * communication is being used.
  58. */
  59.  
  60. /*    plstream.h
  61.  
  62.     Contains declarations for PLStream and PLDev structs.
  63.     Also prototypes for stream & device utility functions.
  64. */
  65.  
  66. #include "pdf.h"
  67.  
  68. #ifndef __PLSTREAM_H__
  69. #define __PLSTREAM_H__
  70.  
  71. /*----------------------------------------------------------------------*\
  72.  * Define the PLDev data structure.
  73.  *
  74.  * These are all quantities that must be saved on a per-device basis.
  75.  * Some drivers (xwin, tk) allocate structures defined internally.
  76. \*----------------------------------------------------------------------*/
  77.  
  78. typedef struct {
  79.     PLFLT pxlx, pxly;
  80.     PLINT xold, yold;
  81.  
  82.     PLINT xmin, xmax, xlen;
  83.     PLINT ymin, ymax, ylen;
  84.  
  85.     PLINT xmin_dev, xmax_dev, xlen_dev;
  86.     PLINT ymin_dev, ymax_dev, ylen_dev;
  87.  
  88.     PLFLT xscale_dev, yscale_dev;
  89. } PLDev;
  90.  
  91. /*----------------------------------------------------------------------*\
  92.  * Define the PLStream data structure.
  93.  *
  94.  * This contains a copy of every variable that is stream dependent, which
  95.  * tends to be those which are settable by the user and persist for longer
  96.  * than one plot.
  97.  *
  98.  * Only those quantities listed in the PLStream struct will be preserved
  99.  * for an individual stream.  Note that the lack of every plplot constant
  100.  * means that one should only switch streams at a fairly high level, i.e.
  101.  * on the scale of an entire plot.  Otherwise intermediate quantities
  102.  * will be confused between the streams, possibly resulting in garbage plots.
  103.  * This structure may be expanded in time to improve intra-stream independence,
  104.  * but it is doubtful streams will ever be fully independent (perhaps
  105.  * neither necessary nor desirable? -- time will tell).
  106.  *
  107.  * There are undoubtably some inconsistencies in the declaration & use of
  108.  * the variables below.  This is a result of the continuing evolution of
  109.  * plplot and the numerous authors involved.  Hopefully in time the function
  110.  * of all variables can be fully documented and made more consistent.
  111.  *
  112.  * The quantities in each stream are as follows:
  113.  *
  114.  ***********************************************************************
  115.  *
  116.  * Misc control variables
  117.  *
  118.  * ipls        PLINT    Stream number
  119.  * level    PLINT    Initialization level
  120.  * program    char*    Program name
  121.  *
  122.  ***********************************************************************
  123.  *
  124.  * Palettes (two of them)
  125.  *
  126.  * Color map 0 is intended for static objects, such as boxes, lines, points,
  127.  * labels, etc.  These should be allocated before calling plinit (else you
  128.  * get all 16 by default, which can be undesirable on some platforms).
  129.  * These are then explicitly selected by number (in order of allocation).
  130.  * The lowest number is 0, but this is used for the background color,
  131.  * so all color drivers start with 1 as the default color.  
  132.  *
  133.  * Color map 1 is for continuous-tone plots, where color is used to
  134.  * represent function value or intensity.  These are set in a relative way
  135.  * only, for increased portability and flexibility.  The actual number of
  136.  * colors used to represent intensity levels is determined by the driver.
  137.  * Note that it is only necessary to specify intensity (on a scale from 0
  138.  * to 1) to get an appropriate color.  Drivers incapable of fine shading
  139.  * will do the best job they can.
  140.  *
  141.  * A palette selection tool for both palettes is available for the Tk
  142.  * driver.  Direct writing of RGB values (i.e.  banging on the hardware) is
  143.  * supported but highly discouraged (colors so written will be affected
  144.  * unpredictably by the palette tools).
  145.  *
  146.  * icol0    PLINT    Color map 0 entry, current color (0 <= icol0 <= 15)
  147.  * ncol0    PLINT    Number of colors allocated in color map 0.
  148.  * icol1    PLINT    Color map 1 entry, current color (0 <= icol1 <= 255)
  149.  * ncol1    PLINT    Number of colors allocated in color map 1.
  150.  * ncol1cp    PLINT    Number of control points in cmap1 allocation (max 32)
  151.  * lcol1cp    PLFLT    Locations of control points in cmap1 [0,1]
  152.  * curcmap    PLINT    Current color map
  153.  * curcolor    RGB[]    Current color
  154.  * cmap0     RGB[]    Color map 0: maximum of 16 RGB 8-bit values
  155.  * cmap1     RGB[]    Color map 1: maximum of 256 RGB 8-bit values
  156.  *
  157.  * cmap0setcol    int[]    Set for initialized cmap0 colors.
  158.  * cmap1set    int    Set if cmap 1 has been initialized
  159.  *
  160.  ***********************************************************************
  161.  *
  162.  * Variables governing pen width 
  163.  *
  164.  * width    Current pen width
  165.  * widthset    Set if pen width was specified
  166.  * widthlock    Set if pen width is locked
  167.  *
  168.  ***********************************************************************
  169.  *
  170.  * Variables used to pass information between the core and the driver 
  171.  *
  172.  * It would be nice to use the "dev_" prefix uniformly but changing
  173.  * all that old code would be quite a lot of work..
  174.  *
  175.  * device    PLINT    Graphics device id number
  176.  * dev_minor    PLINT    Minor device id (for variations on one type)
  177.  * color    PLINT    Set if color is available
  178.  * colorset    PLINT    Set if "color" was set prior to calling plinit
  179.  * plbuf_write    PLINT    Set if driver needs to use the plot buffer
  180.  * dev_fill0    PLINT    Set if driver can do solid area fills
  181.  * dev_fill1    PLINT    Set if driver can do pattern area fills
  182.  * dev_di    PLINT    Set if driver wants to handle DI commands
  183.  * dev_flush    PLINT    Set if driver wants to handle flushes itself
  184.  * termin    PLINT    Set for interactive devices
  185.  * graphx    PLINT    Set if currently in graphics mode
  186.  * nopause    PLINT    Set if we are skipping the pause between frames
  187.  * family    PLINT    Set if familying is enabled
  188.  * member    PLINT    Number of current family member file open
  189.  * finc        PLINT    Number to increment between member files
  190.  * fflen    PLINT    Minimum field length to use in member file number
  191.  * bytemax    PLINT    Number of bytes maximum per member file
  192.  * famadv    PLINT    Set to advance to the next family member
  193.  * DevName    char*    Device name
  194.  * OutFile    FILE    Output file pointer
  195.  * BaseName    char*    Output base name (i.e. family)
  196.  * FileName    char*    Output file name
  197.  * output_type    int    0 for file, 1 for stream
  198.  * bytecnt    PLINT    Byte count for output stream
  199.  * page        PLINT    Page count for output stream
  200.  * linepos    PLINT    Line count for output stream
  201.  * pdfs        PDFstrm* PDF stream pointer
  202.  *
  203.  * These are used by the escape function (for area fill, etc).
  204.  *
  205.  * dev_npts    PLINT    Number of points we are plotting
  206.  * dev_x    short*    Pointer to array of x values 
  207.  * dev_y    short*    Pointer to array of x values 
  208.  *
  209.  * The following pointer is for drivers that require device-specific 
  210.  * data.  At initialization the driver should malloc the necessary
  211.  * space and set pls->dev to point to this area.  This way there can
  212.  * be multiple streams using the same driver without conflict.
  213.  *
  214.  * dev        void*    pointer to device-specific data (malloc'ed)
  215.  *
  216.  * User-supplied event handlers for use by interactive drivers (e.g. X).
  217.  * Can be used to take various actions depending on input.  Currently
  218.  * only a keyboard event handler is supported.
  219.  *
  220.  * KeyEH    void*    Keyboard event handler
  221.  * KeyEH_data    void*    Pointer to client data to pass
  222.  *
  223.  * MouseEH    void*    Mouse event handler
  224.  * MouseEH_data    void*    Pointer to client data to pass
  225.  *
  226.  * Variables used for direct specification of device characteristics
  227.  * Not supported by all drivers (or even very many)
  228.  *
  229.  * xdpi..    PLFLT    Device DPI settings in x and y
  230.  * xlength..    PLINT    Device output lengths in x and y
  231.  * xoffset..    PLINT    Device offsets from upper left hand corner
  232.  * pageset    PLINT    Set if page dimensions were specified
  233.  * hack        PLINT    Enables driver-specific hack(s) if set
  234.  *
  235.  ***********************************************************************
  236.  *
  237.  * User customization tidy routine.  This is called before closing a stream
  238.  * to do any program specific cleanup.
  239.  *
  240.  * tidy        void*   pointer to cleanup routine
  241.  * tidy_data    void*   pointer to client data to pass
  242.  *
  243.  ************************************************************************
  244.  *
  245.  * Stuff used by Xlib driver
  246.  *
  247.  * geometry    char*    Window geometry (malloc'ed)
  248.  * window_id    long    X-window window ID
  249.  * nopixmap    int    Set if you want to forbid allocation of pixmaps
  250.  * db        int    Set if you want to double buffer output
  251.  *            (only pixmap is drawn to directly; it is blitted
  252.  *            to output window on EOP or an Expose)
  253.  ***********************************************************************
  254.  *
  255.  * These are for support of the TK driver.
  256.  *
  257.  * server_name    char*    Main window name of server
  258.  * server_host    char*    Name of host to run server on
  259.  * server_port    char*    Port to talk to server on
  260.  * user        char*    Your user name on remote host (for remsh command)
  261.  * plserver    char*    Name of server
  262.  * plwindow    char*    Name of reference server window (malloc'ed)
  263.  * tcl_cmd    char*    TCL command(s) to eval on startup
  264.  * auto_path    char*    Additional directories to autoload
  265.  * bufmax    int    Number of bytes sent before output buffer is flushed
  266.  * dp        int    Use Tcl-DP for communication, if set
  267.  * server_nokill int    Don't kill plserver on a ^C if set
  268.  *
  269.  ***********************************************************************
  270.  *
  271.  * Variables for use by the plot buffer
  272.  *
  273.  * plbufFile    FILE    Plot buffer file pointer
  274.  * plbufOwner    int    Typically set; only zero if current stream is cloned.
  275.  *
  276.  ***********************************************************************
  277.  *
  278.  * Driver interface (DI)
  279.  *
  280.  * difilt    PLINT    Driver interface filter flag
  281.  *
  282.  * dipxmin    PLFLT    
  283.  * dipymin    PLFLT    Min, max relative plot coordinates
  284.  * dipxmax    PLFLT
  285.  * dipymax    PLFLT    
  286.  * dipxax     PLFLT    Plot window transformation:
  287.  * dipxb     PLFLT      x' = dipxax * x + dipxb
  288.  * dipyay     PLFLT
  289.  * dipyb     PLFLT      y' = dipyay * y + dipyb
  290.  *
  291.  * aspdev    PLFLT    Original device aspect ratio
  292.  * aspect    PLFLT    Page aspect ratio
  293.  * aspori    PLFLT    Rotation-induced aspect ratio
  294.  * mar        PLFLT    Page margin (minimum)
  295.  * jx        PLFLT    Page justification in x
  296.  * jy        PLFLT    Page justification in y
  297.  *
  298.  * didxax     PLFLT    Device window transformation:
  299.  * didxb     PLFLT      x' = didxax * x + didxb
  300.  * didyay     PLFLT
  301.  * didyb     PLFLT      y' = didyay * y + didyb
  302.  *
  303.  * diclpxmi    PLINT
  304.  * diclpxma    PLINT    Device clip limits
  305.  * diclpymi    PLINT
  306.  * diclpyma    PLINT
  307.  *
  308.  * diorot    PLFLT    Rotation angle (in units of pi/2)
  309.  * dioxax    PLFLT    Orientation transformation:
  310.  * dioxay    PLFLT      x' = dioxax * x + dioxay * y + dioxb
  311.  * dioxb     PLFLT
  312.  * dioyax    PLFLT      y' = dioyax * x + dioyay * y + dioyb
  313.  * dioyay    PLFLT
  314.  * dioyb     PLFLT
  315.  *
  316.  * dimxmin    PLFLT    
  317.  * dimymin    PLFLT    Target coordinate system parameters.
  318.  * dimxmax    PLFLT
  319.  * dimymax    PLFLT    
  320.  * dimxpmm    PLFLT
  321.  * dimypmm    PLFLT
  322.  * dimxax     PLFLT    Map meta to physical coordinates:
  323.  * dimxb     PLFLT      x' = dimxax * x + dimxb
  324.  * dimyay     PLFLT
  325.  * dimyb     PLFLT      y' = dimyay * y + dimyb
  326.  *
  327.  * status    PLINT    Flag to indicate current action
  328.  *
  329.  ***********************************************************************
  330.  *
  331.  * Fill pattern state information. 
  332.  * patt < 0: Hardware fill, if available (not implemented yet)
  333.  * patt ==0: Hardware fill, if available, solid
  334.  * patt > 0: Software fill
  335.  *
  336.  * patt        Fill pattern number
  337.  * inclin    Array of inclinations in tenths of degree for fill lines
  338.  * delta    Array of spacings in micrometers between fill lines
  339.  * nps        Number of distinct line styles for fills
  340.  *
  341.  ***********************************************************************
  342.  *
  343.  * Variables used in line drawing
  344.  *
  345.  * currx    Physical x-coordinate of current point
  346.  * curry    Physical y-coordinate of current point
  347.  * mark        Array of mark lengths in micrometers for broken lines
  348.  * space    Array of space lengths in micrometers for broken lines
  349.  * nms        Number of elements for current broken line style
  350.  * timecnt    Timer for broken lines
  351.  * alarm    Alarm indicating change of broken line status
  352.  * pendn    Flag indicating if pen is up or down
  353.  * curel    Current element within broken line
  354.  *
  355.  ***********************************************************************
  356.  *
  357.  * Variables governing character strings
  358.  *
  359.  * esc        Text string escape character
  360.  *
  361.  ***********************************************************************
  362.  *
  363.  * Scale factors for characters, symbols, and tick marks.
  364.  *
  365.  * scale    Scaling factor for chr, sym, maj, min.
  366.  * chr...    Character default height and current (scaled) height
  367.  * sym...    Symbol    default height and current (scaled) height
  368.  * maj...    Major tick default height and current (scaled) height
  369.  * min...    Minor tick default height and current (scaled) height
  370.  *
  371.  ***********************************************************************
  372.  *
  373.  * Variables governing numeric axis label appearance
  374.  *
  375.  * setpre    Non-zero to set precision using "prec"
  376.  * precis    User-specified precision
  377.  * xdigmax..    Allowed #digits in axes labels
  378.  * xdigits..    Actual field widths (returned)
  379.  *
  380.  ***********************************************************************
  381.  *
  382.  * Variables governing physical coordinate system
  383.  *
  384.  * vpp..    Viewport boundaries in physical coordinates
  385.  * spp..    Subpage  boundaries in physical coordinates
  386.  * clp..    Clip     boundaries in physical coordinates
  387.  * phy...    Physical device limits in physical coordinates
  388.  * um.        Number of micrometers in a pixel
  389.  * pmm        Number of pixels to a millimeter
  390.  *
  391.  ***********************************************************************
  392.  *
  393.  * State variables for 3d plots
  394.  *
  395.  * base3.    World coordinate size of base for 3-d plot
  396.  * basec.    Position of centre of base for 3-d plot
  397.  * dom...    Minimum and maximum values for domain
  398.  * zzscl    Vertical (z) scale for 3-d plot
  399.  * ran..    Minimum and maximum z values for 3-d plot
  400.  * c..        Coordinate transformation from 3-d to 2-d
  401.  *
  402.  ***********************************************************************
  403.  *
  404.  * Variables governing subpages and viewports.
  405.  *
  406.  * nsub...    Number of subpages on physical device
  407.  * cursub    Current subpage
  408.  * spd...    Subpage  boundaries in normalized device coordinates
  409.  * vpd...    Viewport boundaries in normalized device coordinates
  410.  * vpw...    Viewport boundaries in world coordinates
  411.  *
  412.  ***********************************************************************
  413.  *
  414.  * Transformation variables
  415.  *
  416.  * wp....    Transformation variables for world  to physical conversion
  417.  * dp....    Transformation variables for device to physical conversion
  418.  * mp....    Transformation variables for millimeters from bottom left
  419.  *        hand corner to physical coordinates
  420.  * wm....    Transformation variables for world coordinates to mm
  421.  *
  422. \*----------------------------------------------------------------------*/
  423.  
  424. typedef struct {
  425.  
  426. /* Misc control information */
  427.  
  428.     PLINT ipls;
  429.     PLINT level;
  430.     char *program;
  431.  
  432. /* Colormaps */
  433.  
  434.     PLINT icol0, ncol0, icol1, ncol1, ncp1, curcmap;
  435.     int   cmap0setcol[16], cmap1set;
  436.  
  437.     PLColor curcolor;
  438.     PLColor cmap0[16];
  439.     PLColor cmap1[256];
  440.  
  441.     PLControlPt cmap1cp[32];
  442.  
  443. /* Variables governing pen width */
  444.  
  445.     PLINT width;
  446.     PLINT widthset, widthlock;
  447.  
  448. /* Variables used for interacting with or by device driver */
  449.  
  450.     PLINT plbuf_write;
  451.     PLINT device, dev_minor, termin, graphx, nopause;
  452.     PLINT color, colorset;
  453.     PLINT family, member, finc, fflen, bytemax, famadv;
  454.     PLINT dev_fill0, dev_fill1, dev_di, dev_flush;
  455.  
  456.     char DevName[80];
  457.     FILE *OutFile;
  458.     char *BaseName, *FileName;
  459.     int  output_type;
  460.     PLINT bytecnt, page, linepos;
  461.     PDFstrm *pdfs;
  462.  
  463.     PLINT dev_npts;
  464.     short *dev_x, *dev_y;
  465.  
  466.     void *dev;
  467.  
  468.     void (*KeyEH)    (PLKey *, void *, int *);
  469.     void *KeyEH_data;
  470.  
  471.     void (*MouseEH)    (PLMouse *, void *, int *);
  472.     void *MouseEH_data;
  473.  
  474.     PLFLT xdpi, ydpi;
  475.     PLINT xlength, ylength;
  476.     PLINT xoffset, yoffset;
  477.     PLINT pageset, hack;
  478.  
  479. /* Per stream tidy function. */
  480.  
  481.     void (*tidy)    (void *);
  482.     void *tidy_data;
  483.  
  484. /* Stuff used by Xlib driver */
  485.  
  486.     char *geometry;
  487.     long window_id;
  488.     int  nopixmap, db;
  489.  
  490. /* Stuff used by TK, DP drivers */
  491.  
  492.     char *server_name, *server_host, *server_port, *user;
  493.     char *plserver, *plwindow;
  494.     char *tcl_cmd, *auto_path;
  495.     int  bufmax, dp, server_nokill;
  496.  
  497. /* Plot buffer settings */
  498.  
  499.     FILE *plbufFile;
  500.     int  plbufOwner;
  501.  
  502. /* Driver interface (DI) */
  503.  
  504.     PLINT difilt, diclpxmi, diclpxma, diclpymi, diclpyma;
  505.     PLFLT dipxmin, dipymin, dipxmax, dipymax;
  506.     PLFLT dipxax, dipxb, dipyay, dipyb;
  507.     PLFLT aspdev, aspect, aspori, mar, jx, jy;
  508.     PLFLT didxax, didxb, didyay, didyb;
  509.     PLFLT diorot;
  510.     PLFLT dioxax, dioxay, dioxb, dioyax, dioyay, dioyb;
  511.     PLFLT dimxax, dimxb, dimyay, dimyb;
  512.     PLFLT dimxmin, dimymin, dimxmax, dimymax, dimxpmm, dimypmm;
  513.     PLINT status;
  514.  
  515. /* Fill pattern info */
  516.  
  517.     PLINT patt, inclin[2], delta[2], nps;
  518.  
  519. /* Variables used in line drawing */
  520.  
  521.     PLINT currx, curry;
  522.     PLINT mark[10], space[10], nms;
  523.     PLINT timecnt, alarm, pendn, curel;
  524.  
  525. /* Variables governing character strings */
  526.  
  527.     char  esc;
  528.  
  529. /* Scale factors for characters, symbols, and tick marks. */
  530.  
  531.     PLFLT scale;
  532.     PLFLT chrdef, chrht;
  533.     PLFLT symdef, symht;
  534.     PLFLT majdef, majht;
  535.     PLFLT mindef, minht;
  536.  
  537. /* Variables governing numeric axis label appearance */
  538.  
  539.     PLINT setpre, precis;
  540.     PLINT xdigmax, ydigmax, zdigmax;
  541.     PLINT xdigits, ydigits, zdigits;
  542.  
  543. /* Variables governing physical coordinate system */
  544.  
  545.     PLINT vppxmi, vppxma, vppymi, vppyma;
  546.     PLINT sppxmi, sppxma, sppymi, sppyma;
  547.     PLINT clpxmi, clpxma, clpymi, clpyma;
  548.     PLINT phyxmi, phyxma, phyymi, phyyma;
  549.     PLINT umx, umy;
  550.     PLFLT xpmm, ypmm;
  551.  
  552. /* State variables for 3d plots */
  553.  
  554.     PLFLT base3x, base3y, basecx, basecy;
  555.     PLFLT domxmi, domxma, domymi, domyma;
  556.     PLFLT zzscl, ranmi, ranma;
  557.     PLFLT cxx, cxy, cyx, cyy, cyz;
  558.  
  559. /* Transformation variables */
  560.  
  561.     PLFLT wpxscl, wpxoff, wpyscl, wpyoff;
  562.     PLFLT dpxscl, dpxoff, dpyscl, dpyoff;
  563.     PLFLT mpxscl, mpxoff, mpyscl, mpyoff;
  564.     PLFLT wmxscl, wmxoff, wmyscl, wmyoff;
  565.  
  566. /* Variables governing subpages and viewports. */
  567.  
  568.     PLINT nsubx, nsuby, cursub;
  569.     PLFLT spdxmi, spdxma, spdymi, spdyma;
  570.     PLFLT vpdxmi, vpdxma, vpdymi, vpdyma;
  571.     PLFLT vpwxmi, vpwxma, vpwymi, vpwyma;
  572.  
  573. } PLStream;
  574.  
  575. /*----------------------------------------------------------------------*\
  576.  * Prototypes for stream & device utility functions.
  577. \*----------------------------------------------------------------------*/
  578.  
  579. /* Get the current stream pointer */
  580.  
  581. void
  582. plgpls(PLStream **p_pls);
  583.  
  584. /* Initializes device cmap 1 entry by interpolation from pls->cmap1 entries */
  585.  
  586. void
  587. plcol_interp(PLStream *pls, PLColor *newcolor, int i, int ncol);
  588.  
  589. /* Opens file for output, prompting if not set. */
  590.  
  591. void
  592. plOpenFile(PLStream *pls);
  593.  
  594. /* Sets up next file member name (in pls->FileName), but does not open it. */
  595.  
  596. void
  597. plP_getmember(PLStream *pls);
  598.  
  599. /* Sets up file name & family stem name. */
  600.  
  601. void
  602. plP_sfnam(PLStream *pls, const char *fnam);
  603.  
  604. /* Initializes family file parameters. */
  605.  
  606. void
  607. plFamInit(PLStream *pls);
  608.  
  609. /* Starts new member file of family file set if necessary. */
  610.  
  611. void
  612. plGetFam(PLStream *pls);
  613.  
  614. /* Rotates physical coordinates if necessary for given orientation. */
  615.  
  616. void
  617. plRotPhy(PLINT orient, PLINT xmin, PLINT ymin, PLINT xmax, PLINT ymax,
  618.      int *px, int *py);
  619.  
  620. /* Allocates a standard PLDev structure for device-specific data */
  621.  
  622. PLDev *
  623. plAllocDev(PLStream *pls);
  624.  
  625. #endif    /* __PLSTREAM_H__ */
  626.